<div class="body_content">
   <div class="top_content">
      <div class="left">
	 <div style="margin-right: 20px; margin-top: 8px;margin-bottom: 10px;">
	    <h1>Upload</h1>
	 </div>
      </div>
      <div class="right align_right">
	 
      </div>
   </div>
   <div class="hr"></div>
   <div class="bottom_content">
      <?php
      $this->view->current_user = Auth::getAuth('current_user');
      $auth = Auth::getAuth('current_user');
      $db = new Database();
      $level = $auth['UserType'];
      $user_level = $db->query("SELECT * FROM tbluser_level WHERE id='$level'","row");
      if($user_level['level'] == "Admin"){
      ?>
         <div class="titleBar">
            <div class="left">
               <div class="titlePosition">
                  Upload Your Image Here.
               </div>
            </div>
            <div class="right align_right">
            </div>
         </div>
         <div class="Holdercontent">
            <div class="top">
               <div class="holderLeft">
                  <form id="imageform" action="/upload" method="POST" enctype="multipart/form-data">
                     <div class="fields">
                        <div class="label">Component:</div>
                        <div class="input"><input type="text" name="fileTitle" id="fileTitle" class="textfield_one" maxlength="30" /></div>
                     </div>
                     <div class="fields">
                        <div class="label">Filename:</div>
                        <div class="input">
                           <div style="margin-top: 8px;">
                              <input type="file" name="file" id="file" class="" />
                           </div>
                        </div>
                     </div>
                     <div class="fields">
                        <div class="label">Cabinet:</div>
                        <div class="input showCabinet">
                           <input type="text" name="fileCabinet" id="fileCabinet" class="textfield_one"  maxlength="30"/>
                           
                        </div>
                        <div style="float: left;margin-top: 6px; margin-left: 10px;">
                           <img src="/images/icon/plus.png" class="plus existingCabinet" title="Use existing Cabinet."/>
                           <img src="/images/icon/minus.png" class="minus display createCabinet" title="Create new cabinet."/>
                        </div>
                     </div>
                     <div class="fields" style="border-bottom: none;">
                        <div class="label"></div>
                        <div class="input">
                           <div style="margin-top: 8px;">
                              <input type="button" name="upload" id="upload" class="btn" value="Upload" />
                           </div>
                        </div>
                     </div>
                     
                  </form>
               </div>
               <div class="holderRight">
                  <div id='preview'></div>
               </div>
            </div>
            <div class="down">
               
            </div>
         </div>
      <?php
      }
      ?>
      
      <?php
      $db = new Database();
      $getCabinet = $db->query("SELECT * FROM cabinet","numrows");
      if($getCabinet!=0){
      ?>
      <div style="float: left; margin-top: 10px; width: 100%;">
         <div class="titleBar">
            <div class="holderLeft">
               <div class="titlePosition">
               Choose a cabinet to view their images.
               </div>
            </div>
            <div class="holderRight">
               <img src="/images/loader/zoomloader.gif" style="float: right;margin-right: 20px;margin-top: 2px;" class="display imageloader"/>
            </div>
         </div>
         <div class="Holdercontent">
            <div class="top">
               <div class="holderLeft" style="width: 48%; border-right: 1px solid #ddd;">
               <?php
                  $db = new Database();
                  $getUploadedCabinet = $db->query("SELECT * FROM cabinet","array");
                  $a = 1;
                  foreach($getUploadedCabinet as $data)
                  {
                     echo "<div class='title cursor' style='height:40px;border-bottom:1px solid #ddd;'>";
                     echo "<div class='left chooseCabinet' data-cabinet-action='chooseCabinet' rel='".$data['id']."' data-cabinet-name='".$data['cabinetName']."' style='margin-top:10px;' class='chooseCabinetName'>";
                     echo $a++ . ". " . $data['cabinetName'];
                     echo "</div><div class='right'>";
                     ?>
                     <img src="/images/icon/delete.png"  class=" deleteCabinet fl_right" style="margin-top: 10px;" title="Delete this cabinet."rel="<?php echo $data['id']; ?>"/>
                     
                     <?php
                     echo "</div>";
                     echo 
                     "<br>";
                     echo "</div>";
                  ?>
                  <?php
                  }
               ?>
               </div>
               <div class="holderRight cabinetListImages" style="margin-left: 10px; border-left: 1px solid #ddd;">
                  
               </div>
            </div>
         </div>
      </div>
      <?php
      }
      ?>
      
      </div>
      <div id="imageInformation"></div>
         <div style="float: left; margin-top: 10px; width: 100%;margin-left: 10px;min-height: 600px;" class="imageLoc">
            
         </div>
      <div style="float: left; margin-top: 10px; width: 100%; margin-left: 10px; margin-bottom: 5px;" id="TaggingInformation">
         
      </div>
   </div>
<div id="loadEditTag"></div>
</div>

<script>
     setActivNav('upload');
</script>